import React, { Component } from 'react'
import { withRouter, Link, Switch, Route, HashRouter as Router } from 'react-router-dom'
import { Layout, Menu, Icon, Input, Dropdown } from 'antd';
import '../../static/systemSetup/banner.less'
import SystemKeywords from './system-keywords'//关键词
import SystemIndex from './system-index'//首页管理
import SystemLog from './system-log'//日志管理
import SystemRange from './system-range'//采集范围设置
import SystemBlackList from './system-blackList'//黑名单
import SystemNotice from './system-notice'//系统公告
import SystemWarning from './system-warning'//系统预警
import Keywords2 from './system-words2'//智能模式
import Loading from "./../loading"//加载中样式
import $ from "jquery"
const { Header, Sider, Content } = Layout;

class SystemBase1 extends Component {
  constructor(props) {
    super(props)
    this.state = {
      index: 0,
      index2: 0,
    }
  }

  onChange(num) {
    this.setState({
      index: num,
      index2: num
    })
    switch (num) {
      case 0:
        this.goRouter('/systemBase/systemKeywords')
        break;
      case 1:
        this.goRouter('/systemBase/systemIndex')
        break;
      case 2:
        this.goRouter('/systemBase/systemWarning')
        break;
      case 3:
        this.goRouter('/systemBase/systemRange')
        break;  
      case 4:
        this.goRouter('/systemBase/systemBlackList')
        break;    
    }
  }

  goRouter(d) {
    this.props.history.push(d)
  };

  // onSelect(num) {
  //   this.setState({
  //     index2: num,
  //   })
  //   switch (num) {
  //     case 0:
  //       return this.goRouter('/weixinqun/wechat')
  //     case 1:
  //       return this.goRouter('/weixinqun/friendqun')
  //     case 2:
  //       return this.goRouter('/weixinqun/gongzhong')
  //     case 3:
  //       return this.goRouter('/weixinqun/collectionPoint')
  //     case 4:
  //       this.goRouter('/weixinqun/whole')
  //       break;
  //     case 5:
  //       this.goRouter('/weixinqun/roundBar')
  //       break;
  //     case 6:
  //       this.goRouter('/weixinqun/journalism')
  //       break;
  //     case 7:
  //       this.goRouter('/weixinqun/searchEngines')
  //       break;
  //     case 8:
  //       this.goRouter('/weixinqun/social')
  //       break;
  //     case 9:
  //       this.goRouter('/weixinqun/betan')
  //       break;
  //     case 10:
  //       this.goRouter('/weixinqun/appTable')
  //       break;
  //     case 11:
  //       this.goRouter('/weixinqun/hot')
  //       break;
  //     default:
  //   }
  // }
  render() {
    return (
      <div className='banner'>
        <div className="title">
          <div className='content'>
            <div className={this.state.index === 0 ? 'titelContent one active' : 'titelContent one'} onClick={this.onChange.bind(this, 0)}>监测关键词</div>
            <div className={this.state.index === 1 ? 'titelContent two active' : 'titelContent two'} onClick={this.onChange.bind(this, 1)}>首页管理</div>
            <div className={this.state.index === 2 ? 'titelContent three active' : 'titelContent three'} onClick={this.onChange.bind(this, 2)}>预警设置</div>
            <div className={this.state.index === 3 ? 'titelContent four active' : 'titelContent four'} onClick={this.onChange.bind(this, 3)}>采集范围设置</div>
            <div className={this.state.index === 4 ? 'titelContent five active' : 'titelContent five'} onClick={this.onChange.bind(this, 4)}>黑名单</div>
          </div>
        </div>
        <div className="changeStyle">
          <Content style={{ height: "100%", background: '#fff', position: "relative" }} ref="myInput">
            <Switch>
                  <Route path='/systemBase/systemKeywords' component={SystemKeywords} />
                  <Route path='/systemBase/Keywords2' component={Keywords2} />
                  <Route path='/systemBase/systemIndex' component={SystemIndex} />
                  <Route path='/systemBase/systemWarning' component={SystemWarning} />
                  {/* <Route path='/systemLog' component={SystemLog}/> */}
                  <Route path='/systemBase/systemRange' component={SystemRange} />
                  <Route path='/systemBase/systemBlackList' component={SystemBlackList} />
                  {/* <Route path='/systemNotice' component={SystemNotice}/> */}
            </Switch>
          </Content>
        </div>
      </div>
    )
  }
}

export default SystemBase1